Skip to main content

GetRangeByNumber

Returns an object that represents the selected range of the current sheet using the row/column coordinates for the cell selection.

Syntax

expression.GetRangeByNumber(nRow, nCol);

expression - A variable that represents a ApiWorksheet class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nRowRequirednumberThe row number.
nColRequirednumberThe column number.

Returns

ApiRange

Example

This example shows how to get an object that represents the selected range of the sheet using the row/column coordinates for the cell selection.

var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRangeByNumber(1, 2).SetValue("42");